package com.uzai.console.cashier;

import com.uzai.common.dto.base.UzaiRespVo;
import com.uzai.console.cashier.dto.WxOrderQueryDto;
import com.uzai.console.cashier.fallback.CashierWxPayClientFallBack;
import com.uzai.console.cashier.param.CashierWechatPayParam;
import com.uzai.console.cashier.param.CashierWechatPayQueryParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author mingyang.chen create in 2023/11/9 11:47
 */
@Component
@FeignClient(value = "${client.cashier:uzai-cashier-server}", fallbackFactory = CashierWxPayClientFallBack.class)
public interface CashierWxPayClient {

    @PostMapping("/inner/wechat/pay/placeOrder")
    UzaiRespVo<?> placeOrder(@RequestBody CashierWechatPayParam cashierWechatPayParam);

    @PostMapping("/inner/wechat/pay/queryOrder")
    UzaiRespVo<WxOrderQueryDto> queryOrder(@RequestBody CashierWechatPayQueryParam wechatPayDto);

    @PostMapping("/inner/wechat/pay/closeOrder")
    UzaiRespVo<Boolean> closeOrder(@RequestBody CashierWechatPayQueryParam wechatPayDto);

    @PostMapping("/inner/wechat/pay/refundOrder")
    UzaiRespVo<Boolean> refundOrder(@RequestBody CashierWechatPayParam param);

    @PostMapping("/inner/wechat/pay/queryRefundOrder")
    UzaiRespVo<WxOrderQueryDto> queryRefundOrder(@RequestBody CashierWechatPayQueryParam param);
}
